package Testking14;

public class Flags2 {

	private boolean isReady = false;

	public synchronized void produce(){
		isReady = true;
		notifyAll();
	}

	public synchronized void consume(){
		while(!isReady){
			try{
				wait();
			}catch(Exception e){

			}
			isReady = true;
		}
	}
}

